﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StoreHoursDomain.Entity
{
    public class WeeklyStoreHours
    {
        private StoreHours[] _storeHours;
        public DateTime EffectiveDate { get; set; }

        public int storeId {get;set;}
        public int weeklyID { get; set; }

        public WeeklyStoreHours()
        {
            int length = Enum.GetValues(typeof(DayOfWeek)).Length;
            _storeHours = new StoreHours[7];
        }

        public StoreHours MondayHours
        {
            get { return GetHours(DayOfWeek.Monday); }
            set { SetHours(DayOfWeek.Monday, value); }
        }
        public StoreHours TuesdayHours
        {
            get { return GetHours(DayOfWeek.Tuesday); }
            set { SetHours(DayOfWeek.Tuesday, value); }
        }
        public StoreHours WednesdayHours
        {
            get { return GetHours(DayOfWeek.Wednesday); }
            set { SetHours(DayOfWeek.Wednesday, value); }
        }
        public StoreHours ThursdayHours
        {
            get { return GetHours(DayOfWeek.Thursday); }
            set { SetHours(DayOfWeek.Thursday, value); }
        }
        public StoreHours FridayHours
        {
            get { return GetHours(DayOfWeek.Friday); }
            set { SetHours(DayOfWeek.Friday, value); }
        }
        public StoreHours SaturdayHours
        {
            get { return GetHours(DayOfWeek.Saturday); }
            set { SetHours(DayOfWeek.Saturday, value); }
        }

        public StoreHours SundayHours 
        {
            get { return GetHours(DayOfWeek.Sunday); }
            set { SetHours(DayOfWeek.Sunday, value); }
        }

        public StoreHours GetHours(DayOfWeek weekday)
        {
            return _storeHours[(int)weekday];
        }

        public void SetHours(DayOfWeek weekday, StoreHours hours)
        {
            _storeHours[(int)weekday] = hours;
        }

        public int Count
        { get { return 7; } }
    }
}


/*
public DateTime MondayDate
        {
            get { return GetDate(DayOfWeek.Monday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime TuesdayDate
        {
            get { return GetDate(DayOfWeek.Tuesday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime WednesdayDate
        {
            get { return GetDate(DayOfWeek.Wednesday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime ThursdayDate
        {
            get { return GetDate(DayOfWeek.Thursday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime FridayDate
        {
            get { return GetDate(DayOfWeek.Friday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime SaturdayDate
        {
            get { return GetDate(DayOfWeek.Saturday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }

        public DateTime SundayDate
        {
            get { return GetDate(DayOfWeek.Sunday); }
            set { SetDate(DayOfWeek.Monday, value); }
        }
  
        public DateTime GetDate(DayOfWeek weekday)
        {
            return _EffectiveDates[(int)weekday];
        }

        public void SetDate(DayOfWeek weekday, DateTime date)
        {
            _EffectiveDates[(int)weekday] = date;
        }
*/